﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using DBA.Common;

namespace DBA.Web.UI
{
    public class BasePage : System.Web.UI.Page
    {
        public string ToDateTimeString(object obj, string formatString)
        {
            return ConvertHelper.ToEvalDateTime(obj, "yyyy-MM-dd");
        }

        public string ToSexString(object obj)
        {
            return ConvertHelper.ToEvalBoolean(obj, "男", "女");
        }

        public string ToGradeString(object obj)
        {
            string reValue = String.Empty;
            switch (ConvertHelper.ToInt16(obj))
            {
                case 1:
                    reValue = "公共职务";
                    break;
                case 2:
                    reValue = "教学类";
                    break;
                case 3:
                    reValue = "科研、学科类";
                    break;
                case 4:
                    reValue = "学生工作类";
                    break;
                case 5:
                    reValue = "其他工作";
                    break;
            }
            return reValue;
        }

        public string ToTeachingGradeString(object obj)
        {
            return ConvertHelper.ToEvelTinyInt(obj, "本科", "普研(含博士)", "专业学位", "其他(非64学时)", "其他");
        }

        public string ToAuditionGradeString(object obj)
        {
            return ConvertHelper.ToEvelTinyInt(obj, "本科生", "普研硕士", "普研博士", "DBA", "MBA", "EMBA", "工程硕士", "留学生");
        }
        public string ToUserTypeString(object obj)
        {
            return ConvertHelper.ToEvelTinyInt(obj, "学生", "教师");
        }
    }
}
